#pragma once
#include <windows.h>

#define HANDLE_MSG_DLG(hwnd,message,fn) \
	case message:\
		return SetDlgMsgResult(hwndDlg, message, HANDLE_##message(hwnd, wParam, lParam, fn))

inline void SetIcon(HWND hwnd, WORD wIcon)
{
	SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(wIcon)));
	SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(wIcon)));
}

void ExecCMD(TCHAR * cmd);
void ExecCMD(TCHAR * cmd, DWORD cchCmd);
void FormatSize(ULONGLONG ullSize, TCHAR * szSize, DWORD len);
LPCTSTR GetClipboard();
void SetClipboard(TCHAR * text);
void ShowError();
DWORD FormatError(DWORD dwError, LPTSTR szError, DWORD dwLength);